package demo.bocweb.com.book.model;

import android.support.annotation.NonNull;

import demo.bocweb.com.book.Api;
import demo.bocweb.com.book.bean.book.BookListBean;
import demo.bocweb.com.book.contract.BookContract;
import demo.bocweb.com.sdk.apiHelper.RetrofitCreateHelper;
import demo.bocweb.com.sdk.apiHelper.RxHelper;
import demo.bocweb.com.sdk.base.BaseModel;
import io.reactivex.Observable;

/**
 * Created by zhelun on 2018/1/18.
 */

public class BookModel extends BaseModel implements BookContract.BookModel {
    @NonNull
    public static BookModel newInstance() {
        return new BookModel();
    }



    @Override
    public Observable<BookListBean> getBookListWithTag(String tag, int start, int count) {
        return RetrofitCreateHelper.createApi(Api.class, Api.HOST)
                .getBookListWithTag(tag,start, count)
                .compose(RxHelper.<BookListBean>rxSchedulerHelper());
    }
}
